<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
   function A() {
       this.name = '文件管理';
   }
   A.prototype.showName = function () {
      alert(this.name);
   };
   function B() {
       A.call(this);
   };

   for(var i in A.prototype){
       B.prototype[i] = A.prototype[i];

       console.log(A.prototype.length)
   }

   B.prototype.fn = function () {
     alert('abc');
   };

   var obja = new A();
   var objb = new B();
   obja.fn();//undefined






  /* var arr1 = [1,2,3];
   var arr2 = [];//var arr2 = arr1

   for(var i=0;i<arr1.length;i++){
       arr2.push(arr1[i]);
   }

   arr2.push(4);
   alert(arr1);*/







</script>
</body>
</html>